﻿namespace Generator.Selections.DataDictionary
{
    public class Column
    {
        public Column(string columnName)
        {
            ColumnName = columnName;
            Selected = true;
        }
        public Column(string columnName, string dataType):this(columnName)
        {
            DataType = dataType;
        }

        public Column(string columnName, string dataType, int maxLen):this(columnName,dataType)
        {
            MaxLen = maxLen;
        }

        public string ColumnName { get; private set; }
        private string _attributeName;

        public string AttributeName
        {
            get
            {
                if (string.IsNullOrEmpty(_attributeName))
                {
                    _attributeName = ColumnName.InitCap();
                }
                return _attributeName;
            }
            set { _attributeName = value; }
        }

        public string DataType { get; set; }
        public int? MaxLen { get; set; }
        public bool Mandatory { get; set; }
        public bool PrimaryKey { get; set; }
        public bool Selected { get; set; }
    }
}
